import 'package:flutter/material.dart';
import 'package:rjpb/components/gap.dart';
import 'package:rjpb/shared/extensions/extensions.dart';
import 'package:rjpb/shared/styles/app_theme.dart';

class TipDialog extends StatelessWidget {
  const TipDialog({
    super.key,
    this.title,
    required this.content,
    required this.actions,
  });
  final String? title;
  final String? content;
  final List<Widget> actions;

  @override
  Widget build(BuildContext context) {
    return Center(
      child: SingleChildScrollView(
        child: Container(
          margin: EdgeInsets.only(
            left: 24.w,
            right: 24.w,
          ),
          padding: EdgeInsets.only(
            left: 24.w,
            right: 24.w,
          ),
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(24.w),
          ),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              const Gap.h(17),
              if (title != null)
                Text(
                  title!,
                  style: Theme.of(context)
                      .textTheme
                      .bodyLarge
                      ?.copyWith(color: AppTheme.red),
                ),
              const Gap.h(40),
              if (content != null)
                Text(
                  content!,
                  style: Theme.of(context).textTheme.bodyLarge?.w500,
                  textAlign: TextAlign.center,
                ),
              const Gap.h(42),
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: actions,
              ),
              const Gap.h(21),
            ],
          ),
        ),
      ),
    );
  }
}
